18. Exercise: Sunshine's New Layout

Sunshine's New Layout

In this exercise, you will get to use the constraint layout to transform our simple text-based interface to a much prettier looking interface for the forecast screen.

ExercĂ­cio: Novo Layout do Sunshine

Now it's your turn to apply what you've learned on Sunshine. Follow the TODOs in the code and make Sunshine look pretty :)

Exercise Code

Exercise: S11.01-Exercise-NewListItemLayout

SOLUTION:
  • Add a ConstraintLayout dependency
  • SReplace the LinearLayout in forecast_list_item.xml with a ConstraintLayout
  • Add new TextViews for each individual weather detail and an ImageView for the weather icon
  • Update the ForecastAdaptor to display the broken-down weather details in the correct views